import request from '@/utils/request'

// 合并购物车
export const insertCart = (data) => {
  return request('/member/cart/merge', 'post', data)
}

// 购物车列表
export const getCartList = () => {
  return request('/member/cart', 'get')
}

// 删除购物车
export const delCart = (data) => {
  return request('/member/cart', 'DELETE', data)
}

// j加入购物车
export const addCart = (data) => {
  return request('/member/cart', 'post', data)
}

// 修改单个商品选中状态和数量
export const changeOneGoodsStatus = (id, data) => {
  return request(`/member/cart/${id}`, 'put', data)
}

// 购物车全选
export const cartAllChange = (data) => {
  return request('/member/cart/selected', 'put', data)
}
